// BCFuglMeyerUpPage.cpp : implementation file
//

#include "stdafx.h"
#include "../Frame/GYWalkAidApp.h"
#include "BCFuglMeyerUpPage.h"
#include "../Common/CommonFun.h"
#include "../Common/GYDataSet.h"
#include "../Common/LinkComboBox.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBCFuglMeyerUpPage dialog


static INPUT_FIELD_INFO s_InputFieldArray1[] = 
{
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("10"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("20"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("30"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("40"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("50"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("60"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("70"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("80"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("90"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("100"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("110"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("120"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("130"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("140"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("150"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("160"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("170"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("180"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("190"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("200"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("210"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("220"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("230"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("240"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("250"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("260"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("270"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("280"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("290"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("300"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("310"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("320"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("330"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("340"),		ftString,	FALSE,	0,	2,		NULL,		NULL	},
};

static INPUT_FIELD_INFO s_InputFieldArray2[] = 
{
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("10"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("20"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("30"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("40"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("50"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("60"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("70"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("80"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("90"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("100"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("110"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("120"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("130"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("140"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("150"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("160"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("170"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("180"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("190"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("200"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("210"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("220"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("230"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("240"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("250"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("260"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("270"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("280"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("290"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("300"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("310"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("320"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("330"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("340"),		ftString,	FALSE,	0,	2,		NULL,		NULL	},
};

static INPUT_FIELD_INFO s_InputFieldArray3[] = 
{
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("10"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("20"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("30"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("40"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("50"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("60"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("70"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("80"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("90"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("100"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("110"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("120"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("130"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("140"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("150"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("160"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("170"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("180"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("190"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("200"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("210"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("220"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("230"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("240"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("250"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("260"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("270"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("280"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("290"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("300"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("310"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("320"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("330"),		ftString,	FALSE,	0,	1,		CBCFuglMeyerUpPage::ScoreFieldsCheck,		CBCFuglMeyerUpPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("340"),		ftString,	FALSE,	0,	2,		NULL,		NULL	},
};


CBCFuglMeyerUpPage::CBCFuglMeyerUpPage(CWnd* pParent, BOOL bBigRes)	: CScrollPage(bBigRes ? CBCFuglMeyerUpPage::IDD : CBCFuglMeyerUpPage::SD_IDD, pParent)
, m_edtFMUp101(&m_InputFieldArray1[0]),		m_edtFMUp201(&m_InputFieldArray2[0]),	m_edtFMUp301(&m_InputFieldArray3[0])
, m_edtFMUp102(&m_InputFieldArray1[1]),		m_edtFMUp202(&m_InputFieldArray2[1]),	m_edtFMUp302(&m_InputFieldArray3[1])
, m_edtFMUp103(&m_InputFieldArray1[2]),		m_edtFMUp203(&m_InputFieldArray2[2]),	m_edtFMUp303(&m_InputFieldArray3[2])
, m_edtFMUp104(&m_InputFieldArray1[3]),		m_edtFMUp204(&m_InputFieldArray2[3]),	m_edtFMUp304(&m_InputFieldArray3[3])
, m_edtFMUp105(&m_InputFieldArray1[4]),		m_edtFMUp205(&m_InputFieldArray2[4]),	m_edtFMUp305(&m_InputFieldArray3[4])
, m_edtFMUp106(&m_InputFieldArray1[5]),		m_edtFMUp206(&m_InputFieldArray2[5]),	m_edtFMUp306(&m_InputFieldArray3[5])
, m_edtFMUp107(&m_InputFieldArray1[6]),		m_edtFMUp207(&m_InputFieldArray2[6]),	m_edtFMUp307(&m_InputFieldArray3[6])
, m_edtFMUp108(&m_InputFieldArray1[7]),		m_edtFMUp208(&m_InputFieldArray2[7]),	m_edtFMUp308(&m_InputFieldArray3[7])
, m_edtFMUp109(&m_InputFieldArray1[8]),		m_edtFMUp209(&m_InputFieldArray2[8]),	m_edtFMUp309(&m_InputFieldArray3[8])
, m_edtFMUp110(&m_InputFieldArray1[9]),		m_edtFMUp210(&m_InputFieldArray2[9]),	m_edtFMUp310(&m_InputFieldArray3[9])
, m_edtFMUp111(&m_InputFieldArray1[10]),	m_edtFMUp211(&m_InputFieldArray2[10]),	m_edtFMUp311(&m_InputFieldArray3[10])
, m_edtFMUp112(&m_InputFieldArray1[11]),	m_edtFMUp212(&m_InputFieldArray2[11]),	m_edtFMUp312(&m_InputFieldArray3[11])
, m_edtFMUp113(&m_InputFieldArray1[12]),	m_edtFMUp213(&m_InputFieldArray2[12]),	m_edtFMUp313(&m_InputFieldArray3[12])
, m_edtFMUp114(&m_InputFieldArray1[13]),	m_edtFMUp214(&m_InputFieldArray2[13]),	m_edtFMUp314(&m_InputFieldArray3[13])
, m_edtFMUp115(&m_InputFieldArray1[14]),	m_edtFMUp215(&m_InputFieldArray2[14]),	m_edtFMUp315(&m_InputFieldArray3[14])
, m_edtFMUp116(&m_InputFieldArray1[15]),	m_edtFMUp216(&m_InputFieldArray2[15]),	m_edtFMUp316(&m_InputFieldArray3[15])
, m_edtFMUp117(&m_InputFieldArray1[16]),	m_edtFMUp217(&m_InputFieldArray2[16]),	m_edtFMUp317(&m_InputFieldArray3[16])
, m_edtFMUp118(&m_InputFieldArray1[17]),	m_edtFMUp218(&m_InputFieldArray2[17]),	m_edtFMUp318(&m_InputFieldArray3[17])
, m_edtFMUp119(&m_InputFieldArray1[18]),	m_edtFMUp219(&m_InputFieldArray2[18]),	m_edtFMUp319(&m_InputFieldArray3[18])
, m_edtFMUp120(&m_InputFieldArray1[19]),	m_edtFMUp220(&m_InputFieldArray2[19]),	m_edtFMUp320(&m_InputFieldArray3[19])
, m_edtFMUp121(&m_InputFieldArray1[20]),	m_edtFMUp221(&m_InputFieldArray2[20]),	m_edtFMUp321(&m_InputFieldArray3[20])
, m_edtFMUp122(&m_InputFieldArray1[21]),	m_edtFMUp222(&m_InputFieldArray2[21]),	m_edtFMUp322(&m_InputFieldArray3[21])
, m_edtFMUp123(&m_InputFieldArray1[22]),	m_edtFMUp223(&m_InputFieldArray2[22]),	m_edtFMUp323(&m_InputFieldArray3[22])
, m_edtFMUp124(&m_InputFieldArray1[23]),	m_edtFMUp224(&m_InputFieldArray2[23]),	m_edtFMUp324(&m_InputFieldArray3[23])
, m_edtFMUp125(&m_InputFieldArray1[24]),	m_edtFMUp225(&m_InputFieldArray2[24]),	m_edtFMUp325(&m_InputFieldArray3[24])
, m_edtFMUp126(&m_InputFieldArray1[25]),	m_edtFMUp226(&m_InputFieldArray2[25]),	m_edtFMUp326(&m_InputFieldArray3[25])
, m_edtFMUp127(&m_InputFieldArray1[26]),	m_edtFMUp227(&m_InputFieldArray2[26]),	m_edtFMUp327(&m_InputFieldArray3[26])
, m_edtFMUp128(&m_InputFieldArray1[27]),	m_edtFMUp228(&m_InputFieldArray2[27]),	m_edtFMUp328(&m_InputFieldArray3[27])
, m_edtFMUp129(&m_InputFieldArray1[28]),	m_edtFMUp229(&m_InputFieldArray2[28]),	m_edtFMUp329(&m_InputFieldArray3[28])
, m_edtFMUp130(&m_InputFieldArray1[29]),	m_edtFMUp230(&m_InputFieldArray2[29]),	m_edtFMUp330(&m_InputFieldArray3[29])
, m_edtFMUp131(&m_InputFieldArray1[30]),	m_edtFMUp231(&m_InputFieldArray2[30]),	m_edtFMUp331(&m_InputFieldArray3[30])
, m_edtFMUp132(&m_InputFieldArray1[31]),	m_edtFMUp232(&m_InputFieldArray2[31]),	m_edtFMUp332(&m_InputFieldArray3[31])
, m_edtFMUp133(&m_InputFieldArray1[32]),	m_edtFMUp233(&m_InputFieldArray2[32]),	m_edtFMUp333(&m_InputFieldArray3[32])
, m_edtFMUp134(&m_InputFieldArray1[33]),	m_edtFMUp234(&m_InputFieldArray2[33]),	m_edtFMUp334(&m_InputFieldArray3[33])
{
	//{{AFX_DATA_INIT(CBCFuglMeyerUpPage)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	
	LPVOID pCtrl = NULL;
	DWORD dwControlType = IBT_NoneType;
	for(int i = 0; i < INPUT_EDIT_CTRL_COUNT; i++)
	{
		pCtrl = m_InputFieldArray1[i].pLinkCtrl;
		dwControlType = m_InputFieldArray1[i].dwCtrlType;
		memcpy(&m_InputFieldArray1[i], &s_InputFieldArray1[i], sizeof(INPUT_FIELD_INFO));
		m_InputFieldArray1[i].pLinkCtrl = pCtrl;
		m_InputFieldArray1[i].dwCtrlType = dwControlType;
		
		pCtrl = m_InputFieldArray2[i].pLinkCtrl;
		dwControlType = m_InputFieldArray2[i].dwCtrlType;
		memcpy(&m_InputFieldArray2[i], &s_InputFieldArray2[i], sizeof(INPUT_FIELD_INFO));
		m_InputFieldArray2[i].pLinkCtrl = pCtrl;
		m_InputFieldArray2[i].dwCtrlType = dwControlType;
		
		pCtrl = m_InputFieldArray3[i].pLinkCtrl;
		dwControlType = m_InputFieldArray3[i].dwCtrlType;
		memcpy(&m_InputFieldArray3[i], &s_InputFieldArray3[i], sizeof(INPUT_FIELD_INFO));
		m_InputFieldArray3[i].pLinkCtrl = pCtrl;
		m_InputFieldArray3[i].dwCtrlType = dwControlType;
	}
}


void CBCFuglMeyerUpPage::DoDataExchange(CDataExchange* pDX)
{
	CScrollPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBCFuglMeyerUpPage)

	DDX_Control(pDX, IDC_EDIT_SCORE1, m_edtFMUp101);
	DDX_Control(pDX, IDC_EDIT_SCORE46, m_edtFMUp102);
	DDX_Control(pDX, IDC_EDIT_SCORE49, m_edtFMUp103);
	DDX_Control(pDX, IDC_EDIT_SCORE52, m_edtFMUp104);
	DDX_Control(pDX, IDC_EDIT_SCORE55, m_edtFMUp105);
	DDX_Control(pDX, IDC_EDIT_SCORE58, m_edtFMUp106);
	DDX_Control(pDX, IDC_EDIT_SCORE61, m_edtFMUp107);
	DDX_Control(pDX, IDC_EDIT_SCORE64, m_edtFMUp108);
	DDX_Control(pDX, IDC_EDIT_SCORE67, m_edtFMUp109);
	DDX_Control(pDX, IDC_EDIT_SCORE70, m_edtFMUp110);
	DDX_Control(pDX, IDC_EDIT_SCORE73, m_edtFMUp111);
	DDX_Control(pDX, IDC_EDIT_SCORE76, m_edtFMUp112);
	DDX_Control(pDX, IDC_EDIT_SCORE79, m_edtFMUp113);
	DDX_Control(pDX, IDC_EDIT_SCORE82, m_edtFMUp114);
	DDX_Control(pDX, IDC_EDIT_SCORE85, m_edtFMUp115);
	DDX_Control(pDX, IDC_EDIT_SCORE88, m_edtFMUp116);
	DDX_Control(pDX, IDC_EDIT_SCORE91, m_edtFMUp117);
	DDX_Control(pDX, IDC_EDIT_SCORE94, m_edtFMUp118);
	DDX_Control(pDX, IDC_EDIT_SCORE97, m_edtFMUp119);
	DDX_Control(pDX, IDC_EDIT_SCORE100, m_edtFMUp120);
	DDX_Control(pDX, IDC_EDIT_SCORE103, m_edtFMUp121);
	DDX_Control(pDX, IDC_EDIT_SCORE106, m_edtFMUp122);
	DDX_Control(pDX, IDC_EDIT_SCORE109, m_edtFMUp123);
	DDX_Control(pDX, IDC_EDIT_SCORE112, m_edtFMUp124);
	DDX_Control(pDX, IDC_EDIT_SCORE115, m_edtFMUp125);
	DDX_Control(pDX, IDC_EDIT_SCORE118, m_edtFMUp126);
	DDX_Control(pDX, IDC_EDIT_SCORE121, m_edtFMUp127);
	DDX_Control(pDX, IDC_EDIT_SCORE124, m_edtFMUp128);
	DDX_Control(pDX, IDC_EDIT_SCORE127, m_edtFMUp129);
	DDX_Control(pDX, IDC_EDIT_SCORE130, m_edtFMUp130);
	DDX_Control(pDX, IDC_EDIT_SCORE133, m_edtFMUp131);
	DDX_Control(pDX, IDC_EDIT_SCORE136, m_edtFMUp132);
	DDX_Control(pDX, IDC_EDIT_SCORE139, m_edtFMUp133);
	DDX_Control(pDX, IDC_EDIT_SCORE142, m_edtFMUp134);

	DDX_Control(pDX, IDC_EDIT_SCORE2,  m_edtFMUp201);
	DDX_Control(pDX, IDC_EDIT_SCORE47, m_edtFMUp202);
    DDX_Control(pDX, IDC_EDIT_SCORE50, m_edtFMUp203);
    DDX_Control(pDX, IDC_EDIT_SCORE53, m_edtFMUp204);
    DDX_Control(pDX, IDC_EDIT_SCORE56, m_edtFMUp205);
	DDX_Control(pDX, IDC_EDIT_SCORE59, m_edtFMUp206);
	DDX_Control(pDX, IDC_EDIT_SCORE62, m_edtFMUp207);
	DDX_Control(pDX, IDC_EDIT_SCORE65, m_edtFMUp208);
	DDX_Control(pDX, IDC_EDIT_SCORE68, m_edtFMUp209);
	DDX_Control(pDX, IDC_EDIT_SCORE71, m_edtFMUp210);
	DDX_Control(pDX, IDC_EDIT_SCORE74, m_edtFMUp211);
	DDX_Control(pDX, IDC_EDIT_SCORE77, m_edtFMUp212);
	DDX_Control(pDX, IDC_EDIT_SCORE80, m_edtFMUp213);
	DDX_Control(pDX, IDC_EDIT_SCORE83, m_edtFMUp214);
	DDX_Control(pDX, IDC_EDIT_SCORE86, m_edtFMUp215);
	DDX_Control(pDX, IDC_EDIT_SCORE89, m_edtFMUp216);
	DDX_Control(pDX, IDC_EDIT_SCORE92, m_edtFMUp217);
	DDX_Control(pDX, IDC_EDIT_SCORE95, m_edtFMUp218);
	DDX_Control(pDX, IDC_EDIT_SCORE98, m_edtFMUp219);
	DDX_Control(pDX, IDC_EDIT_SCORE101, m_edtFMUp220);
	DDX_Control(pDX, IDC_EDIT_SCORE104, m_edtFMUp221);
	DDX_Control(pDX, IDC_EDIT_SCORE107, m_edtFMUp222);
	DDX_Control(pDX, IDC_EDIT_SCORE110, m_edtFMUp223);
	DDX_Control(pDX, IDC_EDIT_SCORE113, m_edtFMUp224);
	DDX_Control(pDX, IDC_EDIT_SCORE116, m_edtFMUp225);
	DDX_Control(pDX, IDC_EDIT_SCORE119, m_edtFMUp226);
	DDX_Control(pDX, IDC_EDIT_SCORE122, m_edtFMUp227);
	DDX_Control(pDX, IDC_EDIT_SCORE125, m_edtFMUp228);
	DDX_Control(pDX, IDC_EDIT_SCORE128, m_edtFMUp229);
	DDX_Control(pDX, IDC_EDIT_SCORE131, m_edtFMUp230);
	DDX_Control(pDX, IDC_EDIT_SCORE134, m_edtFMUp231);
	DDX_Control(pDX, IDC_EDIT_SCORE137, m_edtFMUp232);
	DDX_Control(pDX, IDC_EDIT_SCORE140, m_edtFMUp233);
	DDX_Control(pDX, IDC_EDIT_SCORE143, m_edtFMUp234);

    DDX_Control(pDX, IDC_EDIT_SCORE3,  m_edtFMUp301);
	DDX_Control(pDX, IDC_EDIT_SCORE48, m_edtFMUp302);
	DDX_Control(pDX, IDC_EDIT_SCORE51, m_edtFMUp303);
	DDX_Control(pDX, IDC_EDIT_SCORE54, m_edtFMUp304);
	DDX_Control(pDX, IDC_EDIT_SCORE57, m_edtFMUp305);
	DDX_Control(pDX, IDC_EDIT_SCORE60, m_edtFMUp306);
	DDX_Control(pDX, IDC_EDIT_SCORE63, m_edtFMUp307);
	DDX_Control(pDX, IDC_EDIT_SCORE66, m_edtFMUp308);
	DDX_Control(pDX, IDC_EDIT_SCORE69, m_edtFMUp309);
	DDX_Control(pDX, IDC_EDIT_SCORE72, m_edtFMUp310);
	DDX_Control(pDX, IDC_EDIT_SCORE75, m_edtFMUp311);
	DDX_Control(pDX, IDC_EDIT_SCORE78, m_edtFMUp312);
	DDX_Control(pDX, IDC_EDIT_SCORE81, m_edtFMUp313);
	DDX_Control(pDX, IDC_EDIT_SCORE84, m_edtFMUp314);
	DDX_Control(pDX, IDC_EDIT_SCORE87, m_edtFMUp315);
	DDX_Control(pDX, IDC_EDIT_SCORE90, m_edtFMUp316);
	DDX_Control(pDX, IDC_EDIT_SCORE93, m_edtFMUp317);
	DDX_Control(pDX, IDC_EDIT_SCORE96, m_edtFMUp318);
	DDX_Control(pDX, IDC_EDIT_SCORE99, m_edtFMUp319);
	DDX_Control(pDX, IDC_EDIT_SCORE102, m_edtFMUp320);
	DDX_Control(pDX, IDC_EDIT_SCORE105, m_edtFMUp321);
	DDX_Control(pDX, IDC_EDIT_SCORE108, m_edtFMUp322);
	DDX_Control(pDX, IDC_EDIT_SCORE111, m_edtFMUp323);
	DDX_Control(pDX, IDC_EDIT_SCORE114, m_edtFMUp324);
	DDX_Control(pDX, IDC_EDIT_SCORE117, m_edtFMUp325);
	DDX_Control(pDX, IDC_EDIT_SCORE120, m_edtFMUp326);
	DDX_Control(pDX, IDC_EDIT_SCORE123, m_edtFMUp327);
	DDX_Control(pDX, IDC_EDIT_SCORE126, m_edtFMUp328);
	DDX_Control(pDX, IDC_EDIT_SCORE129, m_edtFMUp329);
	DDX_Control(pDX, IDC_EDIT_SCORE132, m_edtFMUp330);
	DDX_Control(pDX, IDC_EDIT_SCORE135, m_edtFMUp331);
	DDX_Control(pDX, IDC_EDIT_SCORE138, m_edtFMUp332);
	DDX_Control(pDX, IDC_EDIT_SCORE141, m_edtFMUp333);
	DDX_Control(pDX, IDC_EDIT_SCORE144, m_edtFMUp334);

	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBCFuglMeyerUpPage, CScrollPage)
	//{{AFX_MSG_MAP(CBCFuglMeyerUpPage)
	ON_WM_VSCROLL()
	ON_WM_SIZE()
	ON_WM_MOUSEWHEEL()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBCFuglMeyerUpPage message handlers

void CBCFuglMeyerUpPage::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
	//...
	
	CScrollPage::OnVScroll(nSBCode, nPos, pScrollBar);
}

void CBCFuglMeyerUpPage::OnSize(UINT nType, int cx, int cy) 
{
	CScrollPage::OnSize(nType, cx, cy);
	
	//...
}

BOOL CBCFuglMeyerUpPage::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) 
{
	//...
	
	return CScrollPage::OnMouseWheel(nFlags, zDelta, pt);
}

BOOL CBCFuglMeyerUpPage::ClearData()
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	CWnd* apDateLabel[3];
	apDateLabel[0] = GetDlgItem(IDC_STATIC_FMU_DATE_1);
	apDateLabel[1] = GetDlgItem(IDC_STATIC_FMU_DATE_2);
	apDateLabel[2] = GetDlgItem(IDC_STATIC_FMU_DATE_3);
	
	CWnd* apDiagSNArray[3];
	apDiagSNArray[0] = GetDlgItem(IDC_STATIC_DIAGSN1);
	apDiagSNArray[1] = GetDlgItem(IDC_STATIC_DIAGSN2);
	apDiagSNArray[2] = GetDlgItem(IDC_STATIC_DIAGSN3);
	
	return PageClearData(ppCtrlArray, INPUT_EDIT_CTRL_COUNT, apDateLabel, apDiagSNArray, ARRAY_ELE_COUNT(apDateLabel));
}

int CBCFuglMeyerUpPage::SaveData(CString strMRN, int nDiagSN, BOOL bIsDraft)
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	return PageSaveData(strMRN, nDiagSN, bIsDraft, BODYCHECKSCALEID, ppCtrlArray, INPUT_EDIT_CTRL_COUNT);
}

BOOL CBCFuglMeyerUpPage::ScoreFieldsCheck(LPVOID pParam)
{
	CBCFuglMeyerUpPage* pParent = NULL;
	INPUT_FIELD_INFO* pFieldInfo = (INPUT_FIELD_INFO*)pParam;
	
	if(pFieldInfo->dwCtrlType == IBT_EditBox)
	{
		CLinkEdit* pEdit = (CLinkEdit*)pFieldInfo->pLinkCtrl;
		if(pEdit)
			pParent = (CBCFuglMeyerUpPage*)pEdit->GetParent();
	}
	else if(pFieldInfo->dwCtrlType == IBT_ComboBox)
	{
		CLinkComboBox* pCombo = (CLinkComboBox*)pFieldInfo->pLinkCtrl;
		if(pCombo)
			pParent = (CBCFuglMeyerUpPage*)pCombo->GetParent();
	}
	else
	{
		ASSERT(FALSE);
	}
	
	if(pParent == NULL)
	{
		ASSERT(FALSE);
		return FALSE;
	}
	
	return PageScoreFieldsCheck(pParam, 0, 2, pParent->m_InputFieldArray3, INPUT_EDIT_CTRL_COUNT);
}

BOOL CBCFuglMeyerUpPage::ShowTableDataWithStartCol(CString strMRN, int nDiagSN, int nStartCol)
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	CWnd* apDateLabel[3];
	apDateLabel[0] = GetDlgItem(IDC_STATIC_FMU_DATE_1);
	apDateLabel[1] = GetDlgItem(IDC_STATIC_FMU_DATE_2);
	apDateLabel[2] = GetDlgItem(IDC_STATIC_FMU_DATE_3);
	
	CWnd* apDiagSNArray[3];
	apDiagSNArray[0] = GetDlgItem(IDC_STATIC_DIAGSN1);
	apDiagSNArray[1] = GetDlgItem(IDC_STATIC_DIAGSN2);
	apDiagSNArray[2] = GetDlgItem(IDC_STATIC_DIAGSN3);
	
	return PageShowTableData(strMRN, nDiagSN, BODYCHECKSCALEID, ppCtrlArray, INPUT_EDIT_CTRL_COUNT, apDateLabel, apDiagSNArray, nStartCol);
}

BOOL CBCFuglMeyerUpPage::ShowTableData(CString strMRN, int nDiagSN)
{
	return ShowTableDataWithStartCol(strMRN, nDiagSN, 2);
}

BOOL CBCFuglMeyerUpPage::SetLastColTitile(CString strDate, int nDiagSN)
{
	CWnd* apDateLabel[3] = {0};
	apDateLabel[2] = GetDlgItem(IDC_STATIC_FMU_DATE_3);
	
	CString astrDate[3];
	astrDate[2] = strDate;
	
	CWnd* apDiagSNArray[3] = {0};
	apDiagSNArray[2] = GetDlgItem(IDC_STATIC_DIAGSN3);
	
	int anDiagSN[3] = {0};
	anDiagSN[2] = nDiagSN;
	
	return PageShowColTitle(apDateLabel, astrDate, apDiagSNArray, anDiagSN, ARRAY_ELE_COUNT(apDateLabel));
}

BOOL CBCFuglMeyerUpPage::EnableInputControls(BOOL bEnable)
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	return PageEnableInputControls(bEnable, ppCtrlArray, INPUT_EDIT_CTRL_COUNT);
}

BOOL CBCFuglMeyerUpPage::IsPageCurDayBlank()
{
	return CScrollPage::PageIsAllInputBlank(m_InputFieldArray3, INPUT_EDIT_CTRL_COUNT);
}
